package com.usian.admin.controller.v1;

import com.usian.admin.service.AdSensitiveService;
import com.usian.apis.admin.AdSensitiveControllerApis;
import com.usian.model.admin.dtos.ChannelDto;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Auther：DONG on 2021/11/2
 **/
@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController implements AdSensitiveControllerApis {

    @Autowired
    private AdSensitiveService adSensitiveService;


    @Override
    @PostMapping("/list")
    public ResponseResult findByListPage(@RequestBody SensitiveDto dto) {


        return adSensitiveService.findByListPage(dto);
    }

    @Override
    @PostMapping("/save")
    public ResponseResult insert(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.insert(adSensitive);
    }

    @Override
    @PostMapping("/update")
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.updateAdSensitive(adSensitive);
    }

    @DeleteMapping("/del/{id}")
    @Override
    public ResponseResult delete(@PathVariable Integer id) {

        return adSensitiveService.delete(id);
    }
}
